import { onMounted, ref } from "vue";
import { myConfigStore } from "../../../store";
import { showModal } from "../../../utils/utils";

const configStore = myConfigStore();

export default {
    props:{
        serverData:{
            default:function(){
                return {}
            },
            type:Object
        },
        closePopup:{
            default:()=>{},
            type:Function
        }
    },
    setup(props:any) {
        console.log(`------- rider-connect-----`)
        const DB_SYSTEM = configStore.myConfig

        function callPhone(phoneNumber:string){
            uni.makePhoneCall({
                phoneNumber,
                success:()=>{

                },
                fail:(err:any)=>{
                    if(err.errMsg === `makePhoneCall:fail cancel`){
                        return false
                    }
                    showModal({
                        title:`异常提示`,
                        content:`拨打电话失败，请联系在线客服`,
                        showCancel:false
                    })
                }
            });
        }

        return {
            callPhone,
            DB_SYSTEM
        }
    }
}